import { defineStore } from 'pinia';
import waokuimg from '@/images/waoku.jpg';
import wuwuimg from '@/images/wuwu.jpeg';

export const LoginRegsiterSwtich = defineStore('main', {
  state: () => ({
    imgUrls: {
      '/user/Retrieve':waokuimg,
      '/user/register': waokuimg,
      '/user/login': wuwuimg,
    },
    preStyles: {
      '/user/Retrieve':'translateX(100%)',
      '/user/register': 'translateX(100%)',
      '/user/login': 'translateX(0%)',
    }
  }),
  getters: {
    currentImgUrl: (state) => (routePath) => {
      return state.imgUrls[routePath];
    },
    currentPreStyle: (state) => (routePath) => {
      return state.preStyles[routePath];
    }
  }
});